package com.sys.db.daoImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.sys.db.dao.LogFlowDao;
import com.sys.pojo.LogFlow;

public class LogFlowDaoImpl extends SqlMapClientDaoSupport implements LogFlowDao {

	public List findByFlowId(int flowId) throws Exception {
		List list=this.getSqlMapClientTemplate().queryForList("LogFlow.findByFlowId",flowId);
		return list;
	}

	public List findByIdDate(int flowId, String date) throws Exception {
		
		Map map=new HashMap();
		map.put("flowId",flowId);
		map.put("dataDate",date);
		List list=this.getSqlMapClientTemplate().queryForList("LogFlow.findByIdDate",map);
		return list;
	}

	public void save(LogFlow logFlow) throws Exception {
		this.getSqlMapClientTemplate().insert("LogFlow.insert",logFlow);
	}

	public List findByIdDateSuccess(int flowId, String date) throws Exception {
		
		Map map=new HashMap();
		map.put("flowId",flowId);
		map.put("dataDate",date);
		List list=this.getSqlMapClientTemplate().queryForList("LogFlow.findByIdDateSuccess",map);
		return list;
	}

	public LogFlow findById(Integer id) throws Exception {
		LogFlow l=(LogFlow) this.getSqlMapClientTemplate().queryForObject("LogFlow.findById",id);
		return l;
	}

	public void update(LogFlow logFlow) throws Exception {
		this.getSqlMapClientTemplate().update("LogFlow.update",logFlow);
	}

}
